<div class="contentAjax detailViewContainer" style="display:none;">
<div><a href="#" class='exitButton' id="exitButton-<?php echo $engineReturn['modulename'];?>"  name="exitButton-<?php echo $engineReturn['modulename'];?>">x</a></div> 
<table class="table" width="100%">
<?php
	$res	= $engineReturn['record'][0][0];
	foreach($engineReturn['FieldSeting'] as $fs)
	{
		$fieldName = $fs['name'];
		echo "<tr>";
			echo "<td>";
				echo $fs['text'];
			echo "</td>";
			echo "<td>";
					switch($fs['input'])
					{
						case "hidden":
						case "text":
						case "text_primary":
						case "password":
						case "text_area":
						case "text_area_plus_editor":
							echo $res[$fieldName];
						break;
						case "checkbox":
							if(is_array($res[$fieldName]))
							{
								foreach($res[$fieldName] as $v)
								{
									echo $v.", ";
								}
							}
						break;
						case "image":
							if($res[$fieldName]!="")
							{
								echo "<div class='defContainerImage'>";
								echo "<img src='".$res[$fieldName]."'>";
								echo "</div>";
							}
						break;
						case "file":
							if($res[$fieldName]!="")
								echo "<a href='".$res[$fieldName]."' target='_SELF'>"
									."DOWNLOAD</a>";
						break;
						case "radio":
						case "select":
							if(isset($res[$fieldName][1]))
								echo $res[$fieldName][1];
							else
								echo $res[$fieldName][0];
						break;
						case "simple_table":
							if(isset($res[$fieldName]['dataRec']))
								echo $res[$fieldName]['dataRec'];
							else
								echo "-";
						break;
						case "medium_table":
						case "advance_table":
								if(is_array($res[$fieldName]))
								{
									echo "<table class='table'>";
										echo "<tr>";
										foreach($res[$fieldName][1] as $t)
										{
											echo "<td>".$t."</td>";
										}
										echo "</tr>";
										echo "<tr>";
										if(isset($res[$fieldName][0][0]) && is_array($res[$fieldName][0][0]))
										foreach($res[$fieldName][0][0] as $t)
										{
											echo "<td>".$t."</td>";
										}
										echo "</tr>";
									echo "</table>";
								}
						break;
						case "multiple_value":
							$value = $res[$fieldName];
							if(is_array($value) && (count($value)))
							{
								foreach($value as $o=>$v)
								{
									if(is_array($v))
										$v = $v['dataRec'];
									echo "<div class=''>".$v."</div>";
								}
							}
						break;
						case "multiple_value_foreign":
							$value = $res[$fieldName];
							if(is_array($value)&&(count($value)))
							{
								foreach($value as $o=>$v)
								{
								if(isset($v['dataRec']))
								{
									$v = $v['dataRec'];
								}
								echo "<div>".$v."</div>";
								}
							}
							break;
						case "multiple_value_image":
							$value = $res[$fieldName];
							if(is_array($value))
							{
								foreach($value as $id=>$data)
								{
									echo "<div class='defContainerImage'>";
										echo "<img src='".$data['dataRec']."'/>";
									echo "</div>";
									
								}
							}
						break;
					}
			echo "</td>";
		echo "</tr>";
	}
?>
</table>
</div>
<script type="text/javascript">
	$('.contentAjax').delay(100).slideDown('slow');
	$('#exitButton-<?php echo $engineReturn['modulename'];?>').click(function(){
		$(this).parent().parent().fadeOut('slow', function(){
			$(this).parent().parent().html('');
		});
		return false;
	});
</script>